home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / pgm_util / sealit / wizard / vbexampl / vbexampl.bas < prev    next >
Encoding:
BASIC Source File  |  1996-01-07  |  2.1 KB  |  58 lines

  1. Option Explicit
  2. 'Kustom Magic Software, Copyright (c) 1995, Ralph Krausse
  3. 'File Created on 1/7/96 11:03:29 AM
  4.  
  5.  
  6. 'This user-defined data type is what gets passed to the
  7. 'function declared below. All fields must be filled out
  8. Type AppInfo  
  9.      bOverWriteSeal As Integer 'flag to over-write current seal
  10.      szMagicString As String * 20 'magic string, this string detects the seal if there is one
  11.      szAppName As String * 260 'Your magic string
  12. End Type
  13.  
  14.  
  15. Type VERSION
  16.      iMajor As Integer ' Major version
  17.      iMinor As Integer ' Minor version
  18.      iPatch As Integer ' patch version
  19.      bBeta As Integer  ' is version a beta?
  20. End Type
  21.  
  22. 'VBExample Type.......... 
  23. Type VBExample
  24.     bWinNT as Integer
  25.     bWin95 as Integer
  26.     bWin31 as Integer
  27.     dtExpirationDate as Long
  28.     szCompany as String * 60
  29.     szName as String * 40
  30.     szMagicString as String * 20
  31. End Type 
  32.  
  33.  
  34. 'Declarations...
  35. Declare Function ValidateApplication Lib "sealer.dll" (APPINFO As APPINFO, ByVal wSealBufferLen%, vpSealBuffer As Any) As Integer
  36. Declare Sub GetSealError Lib "sealer.dll" (ByVal wErr%, ByVal szErrorString$)
  37. Declare Function SealApplication Lib "sealer.dll" (APPINFO As APPINFO, ByVal wBufferLen%) As Integer
  38. Declare Function InitializeBuffer Lib "sealer.dll" (ByVal wLen%) As Integer
  39. Declare Sub SaveInt Lib "sealer.dll" (ByVal wValue%)
  40. Declare Sub SaveLong Lib "sealer.dll" (ByVal lValue&)
  41. Declare Sub SaveString Lib "sealer.dll" (ByVal lpszValue$, ByVal wLen%)
  42. Declare Sub DeInitializeBuffer Lib "sealer.dll" ()
  43. Declare Sub GetAPIVersion Lib "sealer.dll" (Version as Version)
  44.  
  45. 'Time conversion
  46. Declare Function ConvertDateToLong Lib "sealer.dll" (ByVal wMonth%, ByVal wDay%, ByVal wYear%) As Long
  47. Declare Function ConvertDateFromLong Lib "sealer.dll" (ByVal lTime&, wMonth%, wDay%, wYear%) As Integer
  48.  
  49.  
  50. Function ConvertTime# (tmExpire&)
  51.    Dim wMonth%, wDay%, wYear%, wHour%, wMinutes%
  52.    Dim wErr%, szDateString$,szTimeString$
  53.    wErr% = ConvertDateFromLong(tmExpire&, wMonth%, wDay%, wYear%)
  54.    szDateString$ = wMonth% & "/" & wDay% & "/" & wYear%
  55.    ConvertTime# = DateValue(szDateString$)
  56. End Function
  57.  
  58.